home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / HippoDraw / HippoDrawSrc1.1 / Hippo.subproj / InspectTuple.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-25  |  5.4 KB  |  197 lines

  1. /* InspectTuple    by Paul Kunz    October 1991
  2.  * The supervisor for the tuple inspection panel
  3.  * 
  4.  * Copyright (C)  1991  The Board of Trustees of
  5.  * The Leland Stanford Junior University.  All Rights Reserved.
  6.  */ 
  7.  
  8. #define INSPECTTUPLE_H_ID "$Id: InspectTuple.h,v 1.17 1992/04/13 18:02:48 pfkeb Rel $"
  9.  
  10. #import "InspectBase.h"
  11. #import "hippo.h"
  12.  
  13. #define HD_OK 0
  14. #define HD_NOTEXIST -2
  15. #define HD_CANCEL -1
  16. #define HD_REPLACE 1
  17.  
  18. @interface InspectTuple:InspectBase
  19. {
  20.     id        openPanel;    /* global OpenPanel object */
  21.     id        accessoryView;    /* accessory View for OpenPanel */
  22.     id        msgMatrix;    /* Matrix of TextFields for message */
  23.     id        refFlagMatrix;    /* radio button Matrix */
  24.     id        tupleBrowser;    /* NXBrowser showing tuple titles */
  25.     id        fileForm;    /* Form to hold info on file */
  26.     id        tupleList;    /* List for opened tuples */
  27.     id        tmpTupleList;    /* List used temporary for re-opening file */
  28.     ntuple    selectedTuple;    /* The last selected tuple */
  29. }
  30. -addTuple:(ntuple) nt;
  31.  /*
  32.   * Creates a new HTuple object as a handler for the externally created
  33.   * ntuple nt, add it to the list of handlers and returns the id of it.
  34.   */
  35.   
  36. - initInspFor:aDraw;
  37.  /*
  38.   * Initalizes an object for the global controler aDraw.
  39.   * And adds itself to the NewInspector list.
  40.   */
  41.   
  42. - openTuple:sender;
  43.   /* Opens new binary tuple
  44.    */
  45.    
  46. - openTupleAsText:sender;
  47.   /* Opens new text tuple
  48.    */
  49.    
  50. - openTupleFile;
  51.  /*
  52.   * Opens the tuple file selected by the OpenPanel.  This method
  53.   * does not run the OpenPanel, rather it is called after it has been run.
  54.   */
  55.   
  56. - (int) runModelForTypes;
  57.  /*
  58.   * Runs the openPanel to select tuple binary file with suffix .hippo.
  59.   * Returns HD_OK on success, HD_CANCEL if user canceled.
  60.   */
  61.   
  62. - (int) openTupleFile:(const char *)filename by:(BOOL) refFlag;
  63.   /*
  64.    * Opens new tuples from file filename.
  65.    * The by reference flag for the tuple is set by value of refFlag.
  66.    * Checks if tuple with the same filename already is opened.
  67.    * Returns HD_OK on success, HD_CANCEL if user canceled, or
  68.    * HD_REPLACE if user wants to replace open tuple with one in file.
  69.    */
  70.    
  71. - openAltTupleFile:(const char *)filename;
  72.   /*
  73.    * Runs the OpenPanel to select a file to replace filename and
  74.    * opens the selected n-tuple file.  The altfilename of the
  75.    * opened Tuples is set to filename.   This method is used
  76.    * when opening a document with tuples by reference, and the
  77.    * ntuple file has changed it's path or doesn't exists
  78.    */
  79.    
  80. - openTupleFromFile:(const char *)filename by:(BOOL)refFlag;
  81.   /*
  82.    * Opens ntuple file filename and returns a List of
  83.    * HTuple objects created or nil if file could not be opened.
  84.    * The refFlag is passed to each HTuple object.
  85.    */
  86.    
  87. - openTuple:pasteBoard
  88.     userData:(const char *)args
  89.     error:(char **)errorMsg;
  90.   /*
  91.    * Opens an ascii n-tuple from the pasteboard
  92.    */
  93.    
  94. - newTuple:(ntuple) nt;
  95.   /* Adds a new tuple to the tupleList List object.  
  96.    * Do not use this method, use addTuple: instead.
  97.    */
  98.    
  99. - (BOOL) isNewTupleFile:(const char *)filename;
  100.   /* return YES if tuple file with filename is not in list of
  101.    * currently opened files, otherwise returns NO.
  102.    */
  103.    
  104. - hTupleForTuple:(ntuple) nt;
  105.   /*
  106.    * Returns the HTuple object managing the ntuple nt, or
  107.    * nil if none found.
  108.    */
  109.    
  110. - hTupleForFile:(const char *)filename index:(int)intValue;
  111.   /*
  112.    * Returns the HTuple object that manages the intValue-th ntuple in
  113.    * file filename, or nil if none found.
  114.    */
  115.    
  116. - tupleListForFile:(const char *) filename;
  117.   /*
  118.    * returns a List object containing HTuple objects whose
  119.    * n-tuple is from filename.
  120.    */
  121.    
  122. - setTuple:(ntuple) atuple;
  123.       /* Sets the tuple with already prepared display held by this object
  124.        */
  125.  
  126. - (ntuple) currentTuple;
  127.   /* Returns the currently selected tuple
  128.    */
  129.    
  130. - currentHTuple;
  131.  /*
  132.   * Returns the currently selected HTuple object or
  133.   * nil if none is selected.
  134.   */
  135.   
  136. - bindDisplays;
  137.  /*
  138.   * Sends bindDisplays message to each DrawDocument View.   Used
  139.   * when replacing a n-tuple file.
  140.   */
  141.   
  142. - updateView;
  143.  /*
  144.   * Updates the contents of the Inspector's View
  145.   */
  146.   
  147. - closeTupleFile:(const char *)filename;
  148.  /*
  149.   * Close an n-tuple file after informing each DrawDocument's View
  150.   * that file is about to close.
  151.   */
  152.   
  153. - showPanel;
  154.  /*
  155.   * Orders the NewInspector panel to show the Tuple List and brings
  156.   * Panel front
  157.   */
  158.   
  159. - addTuplesIfAbsent:newList for:aView;
  160.  /*
  161.   * Adds the HTuples contain in the List newList to the tuple List
  162.   * maintained by the receiving object if they are absent.  
  163.   * Informs aView of replacement HTuples.  Frees
  164.   * and HTuples in newList that are duplicates.
  165.   */
  166.   
  167. - select:sender;
  168.   /* Responds to OK button on tupleInspPanel by selecting possible new
  169.    * tuple as the selected tuple and ordering out the panel
  170.    */
  171.    
  172. - replace:sender;
  173.   /*
  174.    * Responds to the Replace button on tupleInspPanel by sending replace
  175.    * tuple message to the graphics view
  176.    */
  177.  
  178. - close:sender;
  179.   /*
  180.    * Responds to the Close Button by closing the n-tuple after
  181.    * informing all DrawDocument Views.
  182.    */
  183.    
  184. - browserSelect:sender;
  185.   /* Responds to selection in the tuple Browser.
  186.    */
  187.    
  188. - (int) browser: sender fillMatrix: matrix inColumn: (int) column;
  189.   /* delegate method for NXBrowser that displays titles of active tuples
  190.    */
  191. - setMsgMatrix:anObject;
  192.   /*
  193.    * Receives the id of the message matrix and clears the text
  194.    * set by the Interface Builder
  195.    */
  196. @end
  197.